//
//  ChooseGiftView.m
//  GiftNote
//
//  Created by wsh on 15/8/19.
//  Copyright (c) 2015年 GN. All rights reserved.
//

#import "ArtifactCollectionViewCell.h"
#import "Screen.h"
#import "INHeader.h"
#import "UIImageView+WebCache.h"


@implementation ArtifactCollectionViewCell

- (id)initWithFrame:(CGRect)frame{
    
    if (self = [super initWithFrame:frame]){
        
        _picIageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.width)];
        _picIageView.backgroundColor = [UIColor blackColor];
        [self.contentView addSubview:_picIageView];
        
        
        self.goodsName = [[UILabel alloc]initWithFrame:CGRectMake(0, frame.size.width, (SCREEN_WIDTH - 40) / 2.0, 40)];
        
        _goodsName.text = @"甜美美花边全裤裙";
        _goodsName.numberOfLines = 2;
        _goodsName.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:_goodsName];
        
        
        UILabel *labelImage = [[UILabel alloc]initWithFrame:CGRectMake(5, frame.size.height - 20 + 5, 15, 15)];
        labelImage.text = @"￥";
        labelImage.font = [UIFont systemFontOfSize:15];
        labelImage.textColor = [UIColor redColor];
        [self.contentView addSubview:labelImage];
        
       self.money = [[UILabel alloc]initWithFrame:CGRectMake(20, frame.size.height - 20, 70, 25)];
        _money.text = @"8888.88";
        _money.font = [UIFont systemFontOfSize:14];
        _money.textColor = [UIColor redColor];
        [self.contentView addSubview:_money];
        
        UIImageView *myImage = [[UIImageView alloc]initWithFrame:CGRectMake(100, frame.size.height - 20 + 7, 12, 12)];
        myImage.image = [UIImage imageNamed:@"iconfont-xihuan"];
        [self.contentView addSubview:myImage];
        
        
       self.like = [[UILabel alloc]initWithFrame:CGRectMake(120, frame.size.height - 20, 65, 25)];
        _like.text = @"88888";
        _like.font = [UIFont systemFontOfSize:14];
        _like.alpha = 0.5;
        [self.contentView addSubview:_like];
        
    }
    return self;
}


- (void)setModel:(ArtifactModel *)model{

    _model = model;
    
    [self.picIageView sd_setImageWithURL:[NSURL URLWithString:model.cover_image_url] placeholderImage:[UIImage imageNamed:@"placeHolder"]];
    self.goodsName.text = model.name;
    self.money.text = model.price;
    self.like.text = [NSString stringWithFormat:@"%@",model.favorites_count];
}







@end
